<template>
  <div>
    <a href="#" @click="showModal">查看访问</a>
    <a-modal :visible="visible" title="Title" @ok="handleOk">
      <template #footer>
        <a-button key="back" @click="handleCancel">返回</a-button>
        <a-button key="submit" type="primary" :loading="loading" @click="handleOk">确定</a-button>
      </template>
      <p><ChrartsStyleBox></ChrartsStyleBox></p>
    </a-modal>
  </div>
</template>
<script>
import ChrartsStyleBox from '../ChrartsStyleBox/index';
import { defineComponent, ref } from 'vue';
export default defineComponent({
  setup() {
    const loading = ref(false);
    const visible = ref(false);

    const showModal = () => {
      visible.value = true;
    };

    const handleOk = () => {
      loading.value = true;
      setTimeout(() => {
        loading.value = false;
        visible.value = false;
      }, 2000);
    };

    const handleCancel = () => {
      visible.value = false;
    };

    return {
      loading,
      visible,
      showModal,
      handleOk,
      handleCancel,
    };
  },
  components:{
      ChrartsStyleBox
  }

});
</script>